package com.sec.controller;

import com.sec.utils.JwtUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/sayHello")
    public String sayHello() {
        return "hello";
    }

    @GetMapping("/sayHi")
    public String sayHi() {
        return "hi";
    }

    @PostMapping("/login")
    public String login() {
        String jwt = JwtUtil.createToken("zhangsan");
        return jwt;
    }
}